package com.ruoyi.psi.purchase.storage.mapper;


import com.ruoyi.psi.base.product.domain.ProduceCheck;
import com.ruoyi.psi.purchase.storage.domain.MaterialAcceptanceRecord;
import com.ruoyi.psi.purchase.storage.domain.PurchaseStorage;
import com.ruoyi.psi.purchase.storage.domain.PurchaseStorageList;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 采购订单入库
 * 数据层
 */
public interface PurchaseStorageMapper {
    /**
     * 采购订单入库查询
     * @param purchaseStorage
     * @return
     */
    public List<PurchaseStorage> selectPurchaseStorageList(PurchaseStorage purchaseStorage);

    /**
     * 按编号查询
     * @param purchaseStorageId 采购订单入库编号
     * @return
     */
    public PurchaseStorage selectPurchaseStorageById(String purchaseStorageId);

    /**
     * 获取最新的一条采购入库编号
     * @return
     */
    public String getPurchaseStorageId();

    /**
     * 采购订单入库新增
     * @param purchaseStorage
     * @return
     */
    public int insertPurchaseStorage(PurchaseStorage purchaseStorage);

    /**
     * 采购订单入库更新
     * @param purchaseStorage
     * @return
     */
    public int updatePurchaseStorage(PurchaseStorage purchaseStorage);

    /**
     * 更新采购订单入库删除标志位
     * @param purchaseStorage
     * @return
     */
    public int updatePurchaseStorageDeleteFlag(PurchaseStorage purchaseStorage);

    /**
     * 采购订单入库详细查询
     * @param purchaseStorageList
     * @return
     */
    public List<PurchaseStorageList> selectPurchaseStorageListList(PurchaseStorageList purchaseStorageList);

    /**
     * 查询采购订单入库对应的所有产品详细
     * @param purchaseStorageId 采购订单入库编号
     * @return
     */
    public List<PurchaseStorageList> selectPurchaseStorageListListById(String purchaseStorageId);

    /**
     * 采购入库新增时查询采购订单对应信息
     * @param purchaseOrderId
     * @return
     */
    public List<PurchaseStorageList> selectPurchaseOrderListForStorage(String purchaseOrderId);
    /**
     * 查询采购订单入库对应的指定产品详细
     * @param purchaseStorageId
     * @return
     */
    public PurchaseStorageList  selectPurchaseStorageListById(@Param("purchaseStorageId")String purchaseStorageId, @Param("produceId")String produceId);

    /**
     * 采购订单入库详细新增
     * @param purchaseStorageList
     * @return
     */
    public int insertPurchaseStorageList(PurchaseStorageList purchaseStorageList);

    /**
     * 采购订单入库详细更新
     * @param purchaseStorageList
     * @return
     */
    public int updatePurchaseStorageList(PurchaseStorageList purchaseStorageList);

    /**
     * 删除采购订单入库详细
     * @param purchaseStorageId  采购订单入库编号
     * @param produceId 产品编号
     * @return
     */
    public int deletePurchaseStorageListById(@Param("purchaseStorageId")String purchaseStorageId, @Param("produceId")String produceId);

    /**
     * 获取指定产品采购入库数量
     * @param produceCheck
     */
    public Double getPurchaseStorageProduceNum(ProduceCheck produceCheck);

    /**
     * 物料验收看板显示类
     * @return
     */
    public List<MaterialAcceptanceRecord> selectProduceForKanBan();
}
